import Vue from 'vue'
import App from '@/App.vue'
//引入路由
import router from "@/router"
//引入全局组件TypeNav
import TypeNav from "@/components/TypeNav"
//引入全局组件Carsouel
import Carsouel from "@/components/Carsouel"
//引入vuex
import store from "@/store"
//引入mockServer
import "@/mock/mockServer"
//引入swiper轮播图样式
import "swiper/css/swiper.css"
//引入全局组件Pager
import Pager from "@/components/Pager"
//引入所有请求接口API
import * as Api from "@/api"
//按需引入ElementUi组件
import {Loading, MessageBox} from 'element-ui'
//把它挂载vue的原型上
Vue.prototype.$msgbox = MessageBox
Vue.prototype.$alert = MessageBox.alert

//导入懒加载的图片
import lazyImg from "@/assets/lazyImg.gif"
//引入图片懒加载插件
import VueLazyload from "vue-lazyload";

//注册插件
Vue.use(VueLazyload,{
  //懒加载的图片
  loading:lazyImg
})


//引入表单校验插件
import "@/plugins/validate"


//注册TypeNav为全局组件
Vue.component(TypeNav.name,TypeNav)
//注册Carsouel为全局组件
Vue.component(Carsouel.name,Carsouel)
//注册Pager为全局组件
Vue.component(Pager.name,Pager)




//关闭生产提示
Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router,
  store,
  beforeCreate(){
    Vue.prototype.$bus = this,
    //将所有请求接口API放入vue的原型中
    Vue.prototype.$Api = Api
  }
}).$mount('#app')
